import cv2 as cv
img = cv.imread('lena.jpg')
resize_img = cv.resize(img,dsize=(200,240))
resize_img1 = cv.resize(img,dsize=(500,600))
cv.imshow('a',resize_img1)
cv.imshow('resize_img',resize_img)
print("修改前的尺寸：",resize_img.shape)
print("修改后的尺寸：",resize_img1.shape)
# cv.waitKey(0)
#只有输入Q才退出
while True:
    if ord('q') == cv.waitKey(0):
        break

cv.destroyAllWindows()